package com.ytjj.qmyx.mall.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.common.controller.BaseController;
import com.ytjj.qmyx.mall.service.WxTransferService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 *
 * @Version: 1.0
 */
@RestController
@RequestMapping("/transfer")
public class TransferController extends BaseController {

	private final WxTransferService wxTransferService;

	public TransferController(WxTransferService wxTransferService) {
		this.wxTransferService = wxTransferService;
	}

	@GetMapping("/wxTransfer")
	public CommonResult wxTransfer(@RequestParam("partnerTradeNo") String partnerTradeNo,
								   @RequestParam("openid") String openid,
								   @RequestParam("amount") String amount,
								   @RequestParam("desc") String desc) throws Exception {
		return CommonResult.success(wxTransferService.transfer(partnerTradeNo, openid, amount, desc));
	}

}
